package org.ycx.upms.dao.model;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;
import org.ycx.common.annotation.FormDesc;
import org.ycx.upms.dao.enmus.BaseState;
import org.ycx.upms.dao.enmus.DelFlag;
import org.ycx.upms.dao.enmus.UserGender;

@FormDesc(pk = "uid")
public class SecUser implements Serializable {
    /**
     * 主键
     */
    @FormDesc(name = "主键", maxLength = 10, type = 1)
    private Integer uid;

    /**
     * 登录名
     */
    @FormDesc(name = "登录名", maxLength = 100, type = 0)
    private String loginName;

    /**
     * 密码
     */
    @FormDesc(name = "密码", maxLength = 64, type = 0)
    private String passwd;

    /**
     * 昵称
     */
    @FormDesc(name = "昵称", maxLength = 100, type = 0)
    private String nickName;

    /**
     * 性别
     */
    @FormDesc(name = "性别", maxLength = 2, type = 4, choice = UserGender.class)
    private String gender;

    /**
     * 手机号
     */
    @FormDesc(name = "手机号", maxLength = 20, type = 0)
    private String mobile;

    /**
     * 邮箱
     */
    @FormDesc(name = "邮箱", maxLength = 100, type = 0)
    private String email;

    /**
     * 头像
     */
    @FormDesc(name = "头像", maxLength = 200, type = 0)
    private String avater;

    /**
     * 密码有效日期
     */
    @FormDesc(name = "密码有效日期", maxLength = 10, type = 3)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date pwdEndDate;

    /**
     * 是否禁用
     */
    @FormDesc(name = "是否禁用", maxLength = 2, type = 4, choice = BaseState.class)
    private String useState;

    /**
     * 删除标志
     */
    @FormDesc(name = "删除标志", maxLength = 2, type = 4, choice = DelFlag.class)
    private String delState;

    /**
     * 创建时间
     */
    @FormDesc(name = "创建时间", maxLength = 10, type = 3)
    private Date createTs;

    /**
     * 创建人
     */
    @FormDesc(name = "创建人", maxLength = 10, type = 1)
    private Integer createUid;

    /**
     * 更新时间
     */
    @FormDesc(name = "更新时间", maxLength = 10, type = 3)
    private Date updateTs;

    /**
     * 更新人
     */
    @FormDesc(name = "更新人", maxLength = 10, type = 1)
    private Integer updateUid;

    private static final long serialVersionUID = 1L;

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAvater() {
        return avater;
    }

    public void setAvater(String avater) {
        this.avater = avater;
    }

    public Date getPwdEndDate() {
        return pwdEndDate;
    }

    public void setPwdEndDate(Date pwdEndDate) {
        this.pwdEndDate = pwdEndDate;
    }

    public String getUseState() {
        return useState;
    }

    public void setUseState(String useState) {
        this.useState = useState;
    }

    public String getDelState() {
        return delState;
    }

    public void setDelState(String delState) {
        this.delState = delState;
    }

    public Date getCreateTs() {
        return createTs;
    }

    public void setCreateTs(Date createTs) {
        this.createTs = createTs;
    }

    public Integer getCreateUid() {
        return createUid;
    }

    public void setCreateUid(Integer createUid) {
        this.createUid = createUid;
    }

    public Date getUpdateTs() {
        return updateTs;
    }

    public void setUpdateTs(Date updateTs) {
        this.updateTs = updateTs;
    }

    public Integer getUpdateUid() {
        return updateUid;
    }

    public void setUpdateUid(Integer updateUid) {
        this.updateUid = updateUid;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", uid=").append(uid);
        sb.append(", loginName=").append(loginName);
        sb.append(", passwd=").append(passwd);
        sb.append(", nickName=").append(nickName);
        sb.append(", gender=").append(gender);
        sb.append(", mobile=").append(mobile);
        sb.append(", email=").append(email);
        sb.append(", avater=").append(avater);
        sb.append(", pwdEndDate=").append(pwdEndDate);
        sb.append(", useState=").append(useState);
        sb.append(", delState=").append(delState);
        sb.append(", createTs=").append(createTs);
        sb.append(", createUid=").append(createUid);
        sb.append(", updateTs=").append(updateTs);
        sb.append(", updateUid=").append(updateUid);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SecUser other = (SecUser) that;
        return (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
                && (this.getLoginName() == null ? other.getLoginName() == null : this.getLoginName().equals(other.getLoginName()))
                && (this.getPasswd() == null ? other.getPasswd() == null : this.getPasswd().equals(other.getPasswd()))
                && (this.getNickName() == null ? other.getNickName() == null : this.getNickName().equals(other.getNickName()))
                && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
                && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
                && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
                && (this.getAvater() == null ? other.getAvater() == null : this.getAvater().equals(other.getAvater()))
                && (this.getPwdEndDate() == null ? other.getPwdEndDate() == null : this.getPwdEndDate().equals(other.getPwdEndDate()))
                && (this.getUseState() == null ? other.getUseState() == null : this.getUseState().equals(other.getUseState()))
                && (this.getDelState() == null ? other.getDelState() == null : this.getDelState().equals(other.getDelState()))
                && (this.getCreateTs() == null ? other.getCreateTs() == null : this.getCreateTs().equals(other.getCreateTs()))
                && (this.getCreateUid() == null ? other.getCreateUid() == null : this.getCreateUid().equals(other.getCreateUid()))
                && (this.getUpdateTs() == null ? other.getUpdateTs() == null : this.getUpdateTs().equals(other.getUpdateTs()))
                && (this.getUpdateUid() == null ? other.getUpdateUid() == null : this.getUpdateUid().equals(other.getUpdateUid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getLoginName() == null) ? 0 : getLoginName().hashCode());
        result = prime * result + ((getPasswd() == null) ? 0 : getPasswd().hashCode());
        result = prime * result + ((getNickName() == null) ? 0 : getNickName().hashCode());
        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
        result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getAvater() == null) ? 0 : getAvater().hashCode());
        result = prime * result + ((getPwdEndDate() == null) ? 0 : getPwdEndDate().hashCode());
        result = prime * result + ((getUseState() == null) ? 0 : getUseState().hashCode());
        result = prime * result + ((getDelState() == null) ? 0 : getDelState().hashCode());
        result = prime * result + ((getCreateTs() == null) ? 0 : getCreateTs().hashCode());
        result = prime * result + ((getCreateUid() == null) ? 0 : getCreateUid().hashCode());
        result = prime * result + ((getUpdateTs() == null) ? 0 : getUpdateTs().hashCode());
        result = prime * result + ((getUpdateUid() == null) ? 0 : getUpdateUid().hashCode());
        return result;
    }
}